//pointer to Data Members

#include <iostream>
#include <cstdio>
using namespace std;
class Point3d {
public:
  virtual void vf(){};
  static Point3d origin;
  double x, y, z;
  double getX() {return x;}
};

int main()
{
  cout<<"sizeof(float)"<<sizeof(float)<<endl;
  cout<<"sizeof(double)"<<sizeof(double)<<endl;
  cout<<"sizeof(Point3d)"<<sizeof(Point3d)<<endl;
  
  double Point3d::*p1 = &Point3d::x;
  double Point3d::*p2 = &Point3d::y;
  cout<<"sizeof(Point3d::*p1)\t"<<sizeof(p1)<<endl;
  if(p1 == p2)
    cout<<"p1==p2"<<endl;
  double (Point3d::*pmf)() = &Point3d::getX;
  cout<<"sizeof(pmf)\t"<<sizeof(pmf)<<endl;
  void (Point3d::*pvmf)() = &Point3d::vf;
  cout<<"sizeof(pvmf)\t"<<sizeof(pvmf)<<endl;

  printf("p1\t%p\n",p1);
  printf("p2\t%p\n",p2);
  printf("p3\t%p\n",&Point3d::z);
  printf("pmf:\t%p\n",pmf);
  printf("pvmf:\t%p\n",pvmf);
  cout<<"&Point3d::x\t"<<&Point3d::x<<endl;
  return 0;
}
